package body ReleasingTask is

   task body RT is

      Next_Period : Ada.Real_Time.Time;
      Period : constant Ada.Real_Time.Time_Span :=
        Ada.Real_Time.Microseconds(Cycle_Time);

      -- Other declarations

      Increment : Positive;

   begin
      -- Initialization code

      Increment := 1;
      Next_Period := Ada.Real_Time.Clock + Ada.Real_Time.Microseconds(Cycle_Time);
      Ada.Text_IO.Put_Line("Activacao do Releasing Task: Inicio do loop");

      loop

         if (Increment mod 5) = 0 then Ada.Synchronous_Task_Control.Set_True(SO.SO);
         else Ada.Synchronous_Task_Control.Set_False(SO.SO);
            end if;

         delay until Next_Period; -- wait until next period after offset
                                  -- Non-suspending periodic response code
                                  -- May include calls to protected procedures

         Next_Period := Next_Period + Period;
         Increment := Increment + 1;

         end loop;
      end RT;
   end ReleasingTask;
